<?php

namespace app\admin\controller\basesetup;

use app\admin\controller\BaseController;
use think\Db;

/**
 * 用户组管理
 * Class GroupController
 * @package app\admin\controller\auth
 */
class PushlistController extends BaseController
{

    /**
     * 主页面
     * @return mixed
     */
    public function index()
    {
        return view();
    }


    /**
     * 列表
     * @return mixed
     */
    public function lists()
    {
        $map = array();
        $data = array();
        $post = $this->request->param();
        if (isset($post['keywork'])) {
            $map[] = ['name', 'like', '%' . $post['keywork'] . '%'];
        }
        $data['count'] = Db::name('push_info')
            ->where($map)->count();
        $data['data'] =  Db::name('push_info')
            ->where($map)
            ->order('id desc')
            ->page(input("page"), input('limit'))
            ->select();
        if ($data['count'] > 0 && $data['data']) {
            $data['msg'] = '获取成功';
        } else {
            $data['msg'] = '获取数据为空';
        }
        $data['code'] = 0;
        return json($data);
    }


}